<?
/*
* Destination
*/
$dest_hot = lang('form.dest_region');

if (isset($_GET['dest_hot']) && ($_GET['dest_hot'] != -1 ) && ($_GET['dest_hot'] != "" ))
$dest_hot = $_GET['dest_hot'];

/*
* Checkin, Checkout
*/
$check_in = date('d.m.Y', strtotime("+1 day"));

if (isset($_GET['check_in']))
$check_in = $_GET['check_in'];

$check_out = date('d.m.Y', strtotime("+2 day"));

if (isset($_GET['check_out']))
$check_out = $_GET['check_out'];

/*
* Number persons
*/
$sel_text = 'selected = "selected"';

if (isset($_GET['nr_adults'])) {
$selected = $_GET['nr_adults'];
$cnt = (isset($_GET['acc_type']) && $_GET['acc_type'] == 'hotel') ? 5 : 12;
} else if (isset($_GET['acc_type']) && $_GET['acc_type'] == 'hotel') {
$selected = 2;
$cnt = 5;
} else {
$selected = 2;
$cnt = 5;
}
?>


<form action="<?= lang_url('search') ?>" method="get" id="search_form" class='form_<?= $this->lang->mci_current() ?>'>

    <fieldset class="bookingControl">
        <legend>Book a <span class="categoryValue">hotel</span></legend>
        <div class="triangle triangleArrow"></div>
        <div class="triangle"></div>
        <div class="bookingControlContent">
            <div class="bcLabel"><?= lang('search.best.60sec'); ?></div>

            <div class="fieldsGroup acc_type"><span class="fieldsGroupTitle"><?= lang('c.type_accomm'); ?>:</span>

                <label><input type="radio" value="hotel" name="acc_type" checked="checked"> <?= lang('nav.hotels'); ?></label>

                <label><input type="radio" value="appartment" name="acc_type"> <?= lang('nav.private'); ?></label>

            </div>

            <div class="fieldsGroup clearfix"> <span class="fieldsGroupTitle"><?= lang('form.destination_name'); ?>:</span>
                <input type="text" value="<?= $dest_hot ?>" name="dest_hot" id="dest_hot" />
            </div>
            <div class="fieldsGroup clearfix"> <span class="fieldsGroupTitle"><?= lang('search.dates'); ?>:</span>
                <div class="fieldsGroupCols2 clearfix">
                    <div> <span><?= lang('form.checkin'); ?></span>
                        <input type="text" value="<?= $check_in ?>" name="check_in" id="check_in" class="checkinout" />
                    </div>
                    <div class="colLast"> <span><?= lang('form.checkout'); ?></span>
                        <input type="text" value="<?= $check_out ?>" name="check_out" id="check_out" class="checkinout"  />

                    </div>
                </div>

                <label>
                    <input type="checkbox" value="" name="specific_date" id="specific_date" /> 
                    <span class="checkboxValue"><?= lang('search.my_dates'); ?></span> 
                </label>

            </div>


            <div class="fieldsGroup clearfix"> <span class="fieldsGroupTitle">Guests:</span>
                <div class="fieldsGroupCols3 clearfix">
                    <div> <span>Rooms</span>
                        <select>
                            <option value="1">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                            <option value="5">5</option>
                        </select>
                    </div>
                    <div> <span><?= lang('form.adults'); ?></span>
                        <select name="nr_adults" id="nr_adults" class='dropdownized'>
                            <? for ($index = 1; $index <= $cnt; $index++): ?>

                            <option value = "<?= $index ?>" <? if ($selected == $index) echo $sel_text; ?>><?= $index ?> </option>

                            <? endfor; ?>
                        </select>
                    </div>
                    <div class="colLast"> <span><?= lang('form.childrens'); ?></span>
                        <select name="nr_childrens" id="nr_childrens" class='dropdownized'>
                            <? for ($index = 0; $index <= $cnt; $index++): ?>

                            <option value = "<?= $index ?>"><?= $index ?> </option>

                            <? endfor; ?>
                        </select>
                    </div>
                </div>
            </div>
            <div class="fieldsGroup fieldsGroupBTN">
                <div class="clearfix">
                    <? if (isset($_GET['currency'])): ?>
                    <input type="hidden" value="<?= $_GET['currency'] ?>" name="currency">
                    <? endif; ?>
                    <input type="submit" value="<?= lang('rentacar.show.best.prices'); ?>" class="showBestPrices">
                    <div class="triangle triangleArrow"></div>
                </div>
            </div>
        </div>
    </fieldset>

</form>